import { defHttp } from '/@/utils/http/axios';
import { IGetMonitorCacheInfoResponse } from '/@/types/monitor/cacheInfo';
import {
  IGetMonitorOnlineUsersQuery,
  IGetMonitorOnlineUsersResponse,
} from '/@/types/monitor/onlineUsers';
import { IGetMonitorServerInfoResponse } from '/@/types/monitor/serverInfo';

/**
 * Redis信息
 */
export const apiGetMonitorCacheInfo = () =>
  defHttp.get<IGetMonitorCacheInfoResponse>({ url: `/monitor/cacheInfo` });
/**
 * 在线用户列表
 */
export const apiGetMonitorOnlineUsersQuery = (params: IGetMonitorOnlineUsersQuery) =>
  defHttp.get<IGetMonitorOnlineUsersResponse>({ url: `/monitor/onlineUsers`, params });
/**
 * 强退用户
 */
export const apiDeleteMonitorOnlineUserPath = (tokenId: string | number) =>
  defHttp.delete({ url: `/monitor/onlineUser/${tokenId}` });
/**
 * 服务器信息
 */
export const apiGetMonitorServerInfo = () =>
  defHttp.get<IGetMonitorServerInfoResponse>({ url: `/monitor/serverInfo` });
